package net.kazed.nextaction.database;

import android.net.Uri;


public class TaskContext {

   public static final Uri ITEM_URI = Uri.parse("content://" + GtdAndroid.PACKAGE + "/taskContext");

   private Long id;
   private int taskId;
   private int contextId;
   
   public TaskContext(Long id, int taskId, int contextId) {
      super();
      this.id = id;
      this.taskId = taskId;
      this.contextId = contextId;
   }

   public TaskContext(int taskId, int contextId) {
      super();
      this.taskId = taskId;
      this.contextId = contextId;
   }

   public Long getId() {
      return id;
   }

   public int getTaskId() {
      return taskId;
   }

   public int getContextId() {
      return contextId;
   }
   
   @Override
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((id == null) ? 0 : id.hashCode());
      result = prime * result + contextId;
      result = prime * result + taskId;
      return result;
   }

   @Override
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      TaskContext other = (TaskContext) obj;
      if (id == null) {
         if (other.id != null)
            return false;
      } else if (!id.equals(other.id))
         return false;
      if (contextId != other.contextId)
         return false;
      if (taskId != other.taskId)
         return false;
      return true;
   }

}
